home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.4 Applications 1997 August / SGI IRIX 6.4 Applications 1997 August.iso / dist / mmailp.idb / usr / lib / Zmail / samples / zscript / oldsave.zsc.z / oldsave.zsc
Encoding:
Text File  |  1997-01-22  |  937 b   |  33 lines

  1. # Sample Z-Script functions: old_saveit
  2.  
  3. # This is the "saveit" function from Version 2.0.5 of Z-Mail, enhanced
  4. # to use the new "ask -f" function, which adds a file Search button to
  5. # the dialog.  This has been replaced in Version 2.1 for consistency
  6. # with the new behavior of the Save Messages item in the File menu.
  7. #
  8. function old_saveit() {
  9.     set mymsgs
  10.     shift -m | set mymsgs
  11.     if X$mymsgs == X
  12.         msg_list . | set mymsgs
  13.     endif
  14.     if ! $?_filename
  15.         if ! $?mbox
  16.             set mbox = ~/mbox
  17.         endif
  18.         set _filename = "$mbox"
  19.         set _choices = "$_filename"
  20.     endif
  21.     if is_gui
  22.         ask -f _filename "Save: $mymsgs\nFilename:" $_choices
  23.     else
  24.         ask -f _filename "Save ${mymsgs} to:" $_choices
  25.     endif
  26.     if $status == 0
  27.         if " $_choices " !~ "* $_filename *"
  28.             set _choices = "$_filename $_choices"
  29.         endif
  30.         save $mymsgs $_filename
  31.     endif
  32. }
  33.